import { id } from 'element-plus/es/locales.mjs';
import http from '../util/http.js';

const API={
    //获取
    get:(url)=>{return http({url:url,method:'get'})},
    // 删除
    del:(url,id,params)=>{
        //url /api/staff
        //id  12
        //url=/api/staff/12   代理数据   /api 换成代理数据  http://localhost:8080
        //url=http://localhost:8080/staff/12
        url=url+'/'+id;
        return http({url:url,method:'delete',params:params})
    },
    //发送from表单数据
    postForm:function(url,params){return http({url:url,method:'post',params:params})},
    //发送Json数据
    postJson:function(url,data){return http({url:url,method:'post',data:data})},


    //发送put请求
    //发送from表单数据
    putForm:function(url,params){return http({url:url,method:'put',params:params})},
    //发送Json数据
    putJson:function(url,data){return http({url:url,method:'put',data:data})},

    getSearch:function(url,params){return http({url:url,method:'get',params:params})},
};
export default API;
